import _ from 'lodash';
import axios from 'axios';

const API_BASE_URL = 'http://127.0.0.1:8000'; // 替换为您的后端API基础URL

const api = axios.create({
    baseURL: API_BASE_URL,
    timeout: 10000, // 设置请求超时时间
});

const getQPEData = _.debounce(async (params) => {
    try {
        const response = await api.get('/weather/get_QPE_data/', {params});
        return response.data;
    } catch (error) {
        throw error;
    }
}, 500);

export {getQPEData};
